package com.sgmder.demo.controller;

import com.sgmder.demo.pojo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserInfoController {

    @GetMapping ("/user/{id}")
    public User getUserById(@PathVariable ("id") Long userId) {

        User user = new User();
        user.setId(userId);
        user.setName("name" + userId);
        user.setPhone("phone" + userId);
        user.setAddress("address" + userId);

        return user;
    }
}
